\hypertarget{class_i_o_device}{\section{I\+O\+Device类 参考}
\label{class_i_o_device}\index{I\+O\+Device@{I\+O\+Device}}
}


I\+O设备抽象类  




{\ttfamily \#include $<$I\+O\+Device.\+h$>$}

类 I\+O\+Device 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_i_o_device}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
virtual sint32 \hyperlink{class_i_o_device_a426aac91300f077d57b1f30c76c7c430}{open} (const char $\ast$device=N\+U\+L\+L, sint32 io\+Mode=I\+O\+\_\+\+M\+O\+D\+E\+\_\+\+I\+N\+V\+A\+L\+I\+D)
\begin{DoxyCompactList}\small\item\em 打开设备 \end{DoxyCompactList}\item 
virtual sint32 \hyperlink{class_i_o_device_a1120c9e7a7c4d0b23083effbe4cb6279}{close} ()
\begin{DoxyCompactList}\small\item\em 关闭设备 \end{DoxyCompactList}\item 
\hypertarget{class_i_o_device_a79ebe9e2d1e2d1f685a8d40664cf6384}{virtual sint32 {\bfseries read\+Data} (char $\ast$buf, sint32 count, sint32 timeout\+Ms=-\/1)=0}\label{class_i_o_device_a79ebe9e2d1e2d1f685a8d40664cf6384}

\item 
\hypertarget{class_i_o_device_ac04b13b59d0cd73bd2d60cef9145c0e9}{virtual sint32 {\bfseries write\+Data} (const char $\ast$buf, sint32 count, sint32 timeout\+Ms=-\/1)=0}\label{class_i_o_device_ac04b13b59d0cd73bd2d60cef9145c0e9}

\item 
\hypertarget{class_i_o_device_aab385fd6e9610d5f972ab7c2154873d8}{virtual sint32 {\bfseries set\+Attribute} (sint32 attr, sint32 value)=0}\label{class_i_o_device_aab385fd6e9610d5f972ab7c2154873d8}

\item 
\hypertarget{class_i_o_device_a0e5a79528498090542181a1147172f9e}{virtual sint32 {\bfseries get\+Attribute} (sint32 attr)=0}\label{class_i_o_device_a0e5a79528498090542181a1147172f9e}

\end{DoxyCompactItemize}
\subsection*{Protected 属性}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_i_o_device_a5ab8e2aa83ad8a53d8ddbb19b23d3688}{sint32 {\bfseries m\+\_\+fd}}\label{class_i_o_device_a5ab8e2aa83ad8a53d8ddbb19b23d3688}

\item 
\hypertarget{class_i_o_device_aa4900690afb4b4d17f90cfe3a9fb504e}{std\+::string {\bfseries m\+\_\+dev\+Name}}\label{class_i_o_device_aa4900690afb4b4d17f90cfe3a9fb504e}

\item 
\hypertarget{class_i_o_device_a5e930bf51c6a266e5be5b2ed62c7ecfa}{sint32 {\bfseries m\+\_\+open\+Mode}}\label{class_i_o_device_a5e930bf51c6a266e5be5b2ed62c7ecfa}

\end{DoxyCompactItemize}


\subsection{详细描述}
I\+O设备抽象类 

\subsection{成员函数说明}
\hypertarget{class_i_o_device_a1120c9e7a7c4d0b23083effbe4cb6279}{\index{I\+O\+Device@{I\+O\+Device}!close@{close}}
\index{close@{close}!I\+O\+Device@{I\+O\+Device}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}sint32 I\+O\+Device\+::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_i_o_device_a1120c9e7a7c4d0b23083effbe4cb6279}


关闭设备 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
设备关闭成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


被 \hyperlink{class_tcp_socket_a58d2fff73fb69eb3f18b00aca7d6c87a}{Tcp\+Socket}, \hyperlink{class_udp_socket_a579acf9700828b5e1c030b37475ec7ea}{Udp\+Socket}, \hyperlink{class_com_port_a75e33f87300daf62df4ae5bd21c0cbc4}{Com\+Port}, \hyperlink{class_socket_a1fe4c90416cad39e96049019d178fb37}{Socket}, \hyperlink{class_file_aabaf3655ddb4e02ea3e2cf5dcdae9391}{File} , 以及 \hyperlink{class_mem_shared_a62a6cdc1ea9b5507139139fce086e84d}{Mem\+Shared} 重载.

\hypertarget{class_i_o_device_a426aac91300f077d57b1f30c76c7c430}{\index{I\+O\+Device@{I\+O\+Device}!open@{open}}
\index{open@{open}!I\+O\+Device@{I\+O\+Device}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}sint32 I\+O\+Device\+::open (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dev\+Name = {\ttfamily NULL}, }
\item[{sint32}]{mode = {\ttfamily IO\+\_\+MODE\+\_\+INVALID}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_i_o_device_a426aac91300f077d57b1f30c76c7c430}


打开设备 


\begin{DoxyParams}{参数}
{\em dev\+Name} & 设备全名(包含路径,如\+:/dev/tty\+S0) \\
\hline
{\em mode} & 打开模式\+I\+O\+\_\+\+M\+O\+D\+E\+\_\+\+E \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
设备打开成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


被 \hyperlink{class_com_port_aae244aab39a2a0321016bc21c5164e24}{Com\+Port}, \hyperlink{class_socket_af9a5eeed90596d23629a4d7777696575}{Socket}, \hyperlink{class_file_a50677171d2d118707a394c6d8480fd14}{File} , 以及 \hyperlink{class_mem_shared_a39df58e72b12e412fb8474bf5d8173e5}{Mem\+Shared} 重载.



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_i_o_device_8h}{I\+O\+Device.\+h}\item 
libemb/src/I\+O\+Device.\+cpp\end{DoxyCompactItemize}
